package com.hc.model.code04.test5.before;

/**
 * @version v1.0
 * @ClassName: Left
 * @Description: 电梯类的子实现类
 * @Author: HC
 */
public class Left implements ILeft{

    private int state;

    @Override
    public void setState(int state) {
        this.state = state;
    }

    @Override
    public void open() {
        switch (state) {
            case OPENING_STATE:
                break;
            case RUNNING_STATE:
                break;
            case CLOSE_STATE:
                System.out.println("电梯打开了。。");
                break;
            case STOP_STATE:
                System.out.println("电梯打开了。。");
                break;
        }
    }

    @Override
    public void running() {
        switch (state) {
            case OPENING_STATE:
                System.out.println("电梯运行了。。");
                break;
            case RUNNING_STATE:
                break;
            case CLOSE_STATE:
                System.out.println("电梯运行了。。");
                break;
            case STOP_STATE:
                System.out.println("电梯运行了。。");
                break;
        }
    }

    @Override
    public void close() {
        switch (state) {
            case OPENING_STATE:
                System.out.println("电梯关闭了。。");
                break;
            case RUNNING_STATE:
                break;
            case CLOSE_STATE:
                break;
            case STOP_STATE:
                System.out.println("电梯关闭了。。");
                break;
        }
    }

    @Override
    public void stop() {
        switch (state) {
            case OPENING_STATE:
                System.out.println("电梯停止了。。");
                break;
            case RUNNING_STATE:
                System.out.println("电梯停止了。。");
                break;
            case CLOSE_STATE:
                break;
            case STOP_STATE:
                break;
        }
    }
}
